#ifndef __XTFP_TASK_HPP__
#define __XTFP_TASK_HPP__
#include "thread_task.hpp"

#include <string>
class xftp_task : public thread_task
{
private:
    /* data */
public:
    xftp_task(/* args */);
    ~xftp_task();
    virtual void read_cb(struct bufferevent *buffer){}
    virtual void event_cb(struct bufferevent *buffer,short what){}
    void set_event_callback(struct bufferevent *buffer);
    virtual bool Init(){return true;}
    // 解析命令
    virtual void parse_cmd(std::string type,std::string msg){}
    // 回复cmd消息
    void recv_cmd(std::string msg);
    bool check_ip(const char *ip);
    xftp_task * m_cmd_task;
    std::string m_master_dir = "/";
    std::string m_work_dir = ".";
    // 相当于传递了文件描述符指针

    std::string ip="";
    int32_t  port = 0;
protected:
    
    struct bufferevent *recv_bffer;
};

#endif